package classexercise;

public class InvoiceItem {
	private String id;
	private String desc;
    private int qty;
    private double unitPrice;
    
    public InvoiceItem(String id,String desc,int qty,double unitPrice){
    	    this.setId(id);
    	    this.setDesc(desc);
    	    this.setQty(qty);
    	    this.setUnitPrice(unitPrice);
    }
    public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public int getQty() {
		return qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}

	public double getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(double unitPrice) {
		this.unitPrice = unitPrice;
	}
    
	public double getTotal(){
		  return unitPrice*qty;
	}
	public String toString(){
		System.out.print("InvoiceItem[id="+id+",desc="+desc+",qty="+qty+",unitPrice="+unitPrice+"] " );
		System.out.println("total="+getTotal());
		return "";
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
        InvoiceItem in =new InvoiceItem("32","65553",685,6445);
        in.toString();
     
        
	}

	
}
